<?php

/**
 * Covenant form base class.
 *
 * @method Covenant getObject() Returns the current form's model object
 *
 * @package    rpgcom
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseCovenantForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'idCovenant'   => new sfWidgetFormInputHidden(),
      'name'         => new sfWidgetFormInputText(),
      'description'  => new sfWidgetFormTextarea(),
      'idSupplement' => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'idCovenant'   => new sfValidatorPropelChoice(array('model' => 'Covenant', 'column' => 'idCovenant', 'required' => false)),
      'name'         => new sfValidatorString(array('max_length' => 50)),
      'description'  => new sfValidatorString(),
      'idSupplement' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Covenant', 'column' => array('name')))
    );

    $this->widgetSchema->setNameFormat('covenant[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Covenant';
  }


}
